package com.atguigu.spring.listener;

import org.springframework.context.ApplicationEvent;

import java.io.Serializable;

/**
 * @author mi
 * @time 2021/4/19 0:37
 */
public class ChangeEvent extends ApplicationEvent implements Serializable {
	private static final long serialVersionUID = 0L;
	private String state;

	/**
	 * Create a new {@code ApplicationEvent}.
	 *
	 * @param source the object on which the event initially occurred or with
	 *               which the event is associated (never {@code null})
	 */
	public ChangeEvent(Object source,String state) {
		super(source);
		this.state = state;
	}

	@Override
	public String toString() {
		return "ChangeEvent{" +
				"state='" + state + '\'' +
				"} " + super.toString();
	}
}
